/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bs.Beans;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Bone
 */
@Entity
@Table(name = "simples_nacional_cabecalho")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "SimplesNacionalCabecalho.findAll", query = "SELECT s FROM SimplesNacionalCabecalho s")})
public class SimplesNacionalCabecalho implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(nullable = false)
    private Integer id;
    @Column(name = "VIGENCIA_INICIAL")
    @Temporal(TemporalType.DATE)
    private Date vigenciaInicial;
    @Column(name = "VIGENCIA_FINAL")
    @Temporal(TemporalType.DATE)
    private Date vigenciaFinal;
    @Column(length = 10)
    private String anexo;
    @Column(length = 10)
    private String tabela;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idSimplesNacionalCabecalho")
    private List<SimplesNacionalDetalhe> simplesNacionalDetalheList;

    public SimplesNacionalCabecalho() {
    }

    public SimplesNacionalCabecalho(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Date getVigenciaInicial() {
        return vigenciaInicial;
    }

    public void setVigenciaInicial(Date vigenciaInicial) {
        this.vigenciaInicial = vigenciaInicial;
    }

    public Date getVigenciaFinal() {
        return vigenciaFinal;
    }

    public void setVigenciaFinal(Date vigenciaFinal) {
        this.vigenciaFinal = vigenciaFinal;
    }

    public String getAnexo() {
        return anexo;
    }

    public void setAnexo(String anexo) {
        this.anexo = anexo;
    }

    public String getTabela() {
        return tabela;
    }

    public void setTabela(String tabela) {
        this.tabela = tabela;
    }

    @XmlTransient
    public List<SimplesNacionalDetalhe> getSimplesNacionalDetalheList() {
        return simplesNacionalDetalheList;
    }

    public void setSimplesNacionalDetalheList(List<SimplesNacionalDetalhe> simplesNacionalDetalheList) {
        this.simplesNacionalDetalheList = simplesNacionalDetalheList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof SimplesNacionalCabecalho)) {
            return false;
        }
        SimplesNacionalCabecalho other = (SimplesNacionalCabecalho) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.bs.Beans.SimplesNacionalCabecalho[ id=" + id + " ]";
    }
    
}
